{% load static viewflow %}
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Viewflow customization sample</title>
        
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
        <link href="{% static 'custom.css' %}" rel="stylesheet">
        <style type="text/css">
          .glyphicon{
              min-width: 15px;
          }
        </style>
    </head>
    
    <body>
        
        <div class="masthead">
            <div class="container">
                <nav class="nav">
                    <ul class="nav navbar-nav">
                        <li><a class="nav-item {% block nav_home_cls%}{% endblock %}" href="/"><span class="glyphicon glyphicon-home"></span> Home</a></li>
                        {% if user.is_authenticated %}
                        <li><a class="nav-item {% block nav_parcels_cls%}{% endblock %}" href="{% url 'parcels' %}"><span class="glyphicon glyphicon-envelope"></span> Parcels</a></li>
                            <li><a class="nav-item {% block nav_tasks_cls %}{% endblock %}" href="{% url 'tasks' %}"><span class="glyphicon glyphicon-tasks"></span> Tasks</a></li>
                            {% if perms.parcel.add_parcel %}
                            <li><a class="nav-item {% block nav_addparcel_cls%}{% endblock %}" href="{% flowurl 'parcel/ShipmentFlow' 'viewflow:start' %}"><span class="glyphicon glyphicon-plus"></span> Add Parcel</a></li>
                            {% endif %}
                        {% endif %}
                    </ul>
                    <ul class="nav navbar-nav pull-right">
                        <li class="dropdown">
                            <a href="#" class="nav-item dropdown-toggle" data-toggle="dropdown">{{ request.user.email|default:"Login" }} <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                {% for user in users %}
                                <li><a class="nav-item" href="{% url 'login_as' %}?user_pk={{ user.pk }}"><i class="glyphicon {% if request.user == user %}glyphicon-ok{% endif %}"></i> {{ user }}</a></li>
                                {% endfor %}
                                {% if user.is_authenticated %}
                                <li><a class="nav-item" href="{% url 'login_as' %}"><i class="glyphicon {% if request.user.is_anonymous %}glyphicon-ok{% endif %}"></i> Logout</a></li>
                                {% endif %}
                            </ul>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
        
        <div class="container">
            
            <div class="blog-header">
                <h1 class="blog-title">Parcel shipping example</h1>
                <p class="lead description">Demo for <a href="http://viewflow.io">Viewflow</a> Library Customization.</p>
            </div>
            
            <div class="row">                
                <div class="col-sm-8">
                    {% block content %}
                    {% endblock %}
                </div>
                
                <div class="col-sm-3 col-sm-offset-1">
                    <div class="sidebar-module">
                        <div class="sidebar-module sidebar-module-inset">
                            <h4>About</h4>
                            <p>Etiam porta <em>sem malesuada magna</em> mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur.</p>
                        </div>
                    </div>
                    <!--div class="sidebar-module">
                        {% if user.is_authenticated %}
                        <h4>Task lists</h4>
                        <ul>
                            <li><a href="#">Assigned</a></li>
                            <li><a href="#">Queue</a></li>
                        </ul>
                        {% endif %}
                    </div-->
                </div>                
            </div>            
        </div>

        <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>        
    </body>
</html>
